#pragma once
#include "Sound.h"
#include "Globals.h"
//#include "Zone.h"
#include "Button.h"
#include "MenuPanel.h"
#include "Pathogen.h"
#include "Input.h"
//#include "Drawable.hpp"	(Abstracted through Button.hpp)
#include "DX_Graphics.h"

class Engine
{
private:

	Engine();

	int CountriesForsaken;
	int CountriesVictorious;


	/*DEBUG VARIABLES									DEBUG VARIABLES	*/
	PrintBox				DebugBox;					
	PrintBox				MousePosition;				

	//GameStats
	int			m_iTotalHealthy;
	int			m_iTotalInfected;
	int			m_iTotalDeceased;

	/*EVENTBOX VARIABLES								EVENTBOX VARIABLES*/
	ostringstream			EventMessage;
	string					NewsStream1;				//Recent News
	string					NewsStream2;				//Recent News
	string					NewsStream3;				//Recent News
	string					NewsStream4;				//Recent News
	string					NewsStream5;				//Recent News

	int						m_iInfZFlag;
	bool					m_bInfectedZones[ZONE_SIZE];//If this is entirely true, the game is won. Also used to track spead of infection
	bool					m_bGameOver;

public:

	inline static Engine* Into()      
	{static Engine engine;return &engine;}

	//=====STARTUP
	void Initialize(HWND,HINSTANCE);

	//=====INITIALIZATION
	void InitializeButtonList(L_Button);
	void InitializeMenuList(L_Menu);

	//=====UPDATE
	void UpdateEventPane(MenuPanel*);
	void UpdateObjects(L_Zone, L_Object,L_Button,L_Menu);
	void UpdateZones(L_Zone);
	void UpdateButtons(L_Button,L_Menu);
	void UpdateMenus(L_Menu);
	void CheckIfGameOver(L_Zone);

	//=====RENDER
	void Render(L_Zone, L_Object, L_Button,L_Menu);	

	//=====ACCESSORS
	bool isZoneInfected(int x) {return m_bInfectedZones[x];};

	//=====MUTATORS
	void InfectNewZone(int);
	void DisinfectZone(int);

	//=====EVENT PANE
	void ModifyEventPane(string);
	void PostInfectedMessage(string);
	void PostCrippledMessage(string);
	void PostForsakenMessage(string);
	void PostVaccinatMessage(string);
	void PostResistorMessage(string);
	void PostExterminMessage(string);

	//=====DEBUG
	void MoveObject(Drawable* tomove);
	void ChangeDebugBoxText(string NewText);
	void ChangeDebugBoxTextToNumber(float Num);

	~Engine(){};
};
